<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<string_resources>
		<string resource_id="access_control_select_resource_id_by_name">
			<value>SELECT ID FROM AccessControlResources WHERE NAME={0}</value>
		</string>
    <string resource_id="access_control_insert_resource">
      <value version="oracle">INSERT INTO AccessControlResources (NAME, CREATED_DATE) VALUES({0}, SYSDATE)</value>
      <value version="sql_server">INSERT INTO AccessControlResources (NAME, CREATED_DATE) VALUES({0}, GETDATE())</value>
      <value>INSERT INTO AccessControlResources (NAME) VALUES({0})</value>
    </string>
    <string resource_id="access_control_insert_acl_entry_by_resource_id">
      <value version="oracle">INSERT INTO AccessControlACL (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS, CREATED_DATE) VALUES({0}, {1}, {2}, SYSDATE)</value>
      <value version="sql_server">INSERT INTO AccessControlACL (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS, CREATED_DATE) VALUES({0}, {1}, {2}, GETDATE())</value>
      <value>INSERT INTO AccessControlACL (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS) VALUES({0}, {1}, {2})</value>
    </string>
    <string resource_id="access_control_insert_acl_entry_by_resource_name">
      <value version="oracle">
        INSERT INTO
        AccessControlACL
        (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS, CREATED_DATE)
        VALUES ((SELECT ID FROM AccessControlResources WHERE NAME={0}), {1}, {2}, SYSDATE);
      </value>
      <value version="sql_server">
        INSERT INTO
        AccessControlACL
        (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS, CREATED_DATE)
        VALUES ((SELECT ID FROM AccessControlResources WHERE NAME={0}), {1}, {2}, GETDATE());
      </value>
      <value>
        INSERT INTO
        AccessControlACL
        (RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS)
        VALUES ((SELECT ID FROM AccessControlResources WHERE NAME={0}), {1}, {2});
      </value>
    </string>
    <string resource_id="access_control_select_acls_by_id">
			<value>SELECT RESOURCE_ID, ACCESSOR_NAME, DENY_ACCESS, CREATED_DATE, MODIFIED_DATE FROM AccessControlACL WHERE RESOURCE_ID={0}</value>
		</string>
    <string resource_id="access_control_select_acls_by_resource_name">
			<value>
        SELECT
        acr.id as resource_id,
        acr.name,
        acl.accessor_name,
        acl.deny_access,
        acl.created_date,
        acl.modified_date
        FROM AccessControlResources AS acr
        LEFT JOIN AccessControlACL AS acl ON acl.resource_id = acr.id
        WHERE acr.name = {0}
      </value>
		</string>
    <string resource_id="access_control_select_acls_by_resource_name_and_accessor_name">
      <value>
        SELECT
        acr.id as resource_id,
        acr.name,
        acl.accessor_name,
        acl.deny_access,
        acl.created_date,
        acl.modified_date
        FROM AccessControlResources AS acr
        LEFT JOIN AccessControlACL AS acl ON acl.resource_id = acr.id
        WHERE acr.name = {0} AND acl.accessor_name = {1}
      </value>
    </string>
    <string resource_id="access_control_delete_all_acl_entries_by_resource_id">
      <value>DELETE FROM AccessControlACL WHERE RESOURCE_ID={0} </value>
    </string>
    <string resource_id="access_control_delete_all_acl_entries_by_resource_name">
      <value>DELETE FROM AccessControlACL WHERE RESOURCE_ID=(SELECT ID FROM AccessControlResources WHERE NAME={0}) </value>
    </string>
    <string resource_id="access_control_delete_acl_entry">
      <value>DELETE FROM AccessControlACL WHERE RESOURCE_ID={0} AND ACCESSOR_NAME={1} </value>
    </string>
    <string resource_id="access_control_delete_resource_by_id">
      <value>DELETE FROM AccessControlResources WHERE ID={0} </value>
    </string>
    <string resource_id="access_control_delete_resource_by_name">
      <value>DELETE FROM AccessControlResources WHERE NAME={0} </value>
    </string>

  </string_resources>

</configuration>